home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group94a.txt / 000172_icon-group-sender _Wed Jun 15 04:24:26 1994.msg < prev    next >
Internet Message Format  |  1994-08-19  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Wed, 15 Jun 1994 08:34:12 MST
  2. Date: 15 Jun 94 04:24:26 GMT
  3. From: news.delphi.com!usenet@uunet.uu.net
  4. Organization: Delphi (info@delphi.com email, 800-695-4005 voice)
  5. Subject: Coexpression Question
  6. Message-Id: <Js+OHX6.cbarilleaux@delphi.com>
  7. Sender: icon-group-request@cs.arizona.edu
  8. To: icon-group@cs.arizona.edu
  9. Status: R
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11.  
  12. Hi! I'm trying to learn Icon, but have reached a road block in my studies.
  13. I wanted to write a "spinner" program, which would use the /,\,-,and |
  14. characters to produces a spinning inmage, by displaying one, using \b
  15. to delete it, then displaying the next. having just finished the chapter
  16. of _The Icon Programming Language_ on co-expressions, so, I thoughtI could
  17. use them. The code looks like this:
  18.  
  19. procedure main()
  20.     spin:=create("\b-"|"\b\\"|"\b|"|"\b/")
  21.     writes(" ")
  22.     every 1 to 50 do {
  23.         writes(@spin)|spin:=^spin
  24.     }
  25.     write("\n")
  26. end
  27.  
  28. However, I try running it, and I get the follwing error messages:
  29.  
  30. C:\PRG\ICON\WORK>iconx spinfoo
  31. -
  32. Run-time error 111
  33. File spinfoo.icn; Line 5
  34. variable expected
  35. offending value: "\b-"
  36. Trace back:
  37.    main()
  38.    {"\b-" := co-expression_3(0)} from line 5 in spinfoo.icn
  39.  
  40. I ahve tried to figure out just what is meant by this. I have figured out a
  41. work-around, but I suspect that alternation like I used can work.
  42.  
  43. Any advice?
  44. Thanks in advance
  45. --
  46. __________________________________________________________________
  47. Charles Barilleaux                        CBARILLEAUX@DELPHI.COM
  48. First Federal Savings & Loan              Lake Charles, Louisiana
  49. PGP Public Key Available Upon Request
  50.